﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace EIMS.Migrations
{
    /// <inheritdoc />
    public partial class addposition : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Type",
                table: "SupplierTransactions",
                newName: "TransactionType");

            migrationBuilder.RenameColumn(
                name: "Phone",
                table: "SupplierContacts",
                newName: "PhoneNumber");

            migrationBuilder.AddColumn<string>(
                name: "Description",
                table: "SupplierTransactions",
                type: "TEXT",
                maxLength: 500,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<int>(
                name: "PaymentMethod",
                table: "SupplierTransactions",
                type: "INTEGER",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdatedAt",
                table: "SupplierTransactions",
                type: "TEXT",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDefault",
                table: "SupplierContacts",
                type: "INTEGER",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<string>(
                name: "Position",
                table: "Employees",
                type: "TEXT",
                maxLength: 50,
                nullable: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Description",
                table: "SupplierTransactions");

            migrationBuilder.DropColumn(
                name: "PaymentMethod",
                table: "SupplierTransactions");

            migrationBuilder.DropColumn(
                name: "UpdatedAt",
                table: "SupplierTransactions");

            migrationBuilder.DropColumn(
                name: "IsDefault",
                table: "SupplierContacts");

            migrationBuilder.DropColumn(
                name: "Position",
                table: "Employees");

            migrationBuilder.RenameColumn(
                name: "TransactionType",
                table: "SupplierTransactions",
                newName: "Type");

            migrationBuilder.RenameColumn(
                name: "PhoneNumber",
                table: "SupplierContacts",
                newName: "Phone");
        }
    }
}
